﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

class TheWorldActiveObjectPause : MonoBehaviour
{


    ActiveObject obj;
    private float pauseTime = 0.0f;

    public TheWorldActiveObjectPause(ActiveObject owner)
    {
        obj = owner;
    }

    public void setPause(float time)
    {
        pauseTime = time;
        
        obj.getAniManager().setAniSpeed(0);
    }

    public bool isPause()
    {
        if (pauseTime > 0.0f)
            return true;
        return false;
    }


    public void onProc()
    {
        if (pauseTime > 0.0f)
        {
            pauseTime = pauseTime - Time.deltaTime;
        }
        else
        {
            obj.getAniManager().setAniSpeed(1);
            pauseTime = 0.0f;
        }
            
    }

    



}

